/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Sesion;

import Entidades.Clientes;
import Entidades.Entradas;
import Entidades.Preguntas;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Daniel
 */
@Stateless
public class EntradasFacade extends AbstractFacade<Entradas> {

    @PersistenceContext(unitName = "PPIGYM-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public EntradasFacade() {
        super(Entradas.class);
    }

    /**
     * metodo par recuperar contraseña
     *
     * @param identificacion
     * @return
     */
    public List<Clientes> findCliente(String identificacion) {
        Query query = null;
        try {
            query = getEntityManager().createNamedQuery("Clientes.findByIdentificacion");
            query.setParameter("identificacion", identificacion);

        } catch (Exception e) {
            System.err.println("findClient");
            e.printStackTrace();
        }
        return query.getResultList();
    }

}
